package me.guowenlong.rxextension.ext;

import io.reactivex.functions.Function;
import me.guowenlong.rxextension.bean.ResponseEntity;
import retrofit2.Response;

/**
 * 类的描述
 *
 * @author guowenlong
 * 创建时间:2019-01-16-2:46
 */
public class FailMap<T> implements Function<Response<ResponseEntity<T>>, T> {
    @Override
    public T apply(Response<ResponseEntity<T>> responseEntityResponse) throws Exception {
        return responseEntityResponse.body() != null ? responseEntityResponse.body().getData() : null;
    }
}
